﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SSharp.Core.Evaluator {
	public static partial class Eval {
		/// <summary>
		/// Evaluates expressions like
		/// (quote a)
		/// or more simply
		/// 'a
		/// which simply returns the contents of the quote
		/// </summary>
		private class QuoteEvaluator : SpecialFormEvaluator {
			public QuoteEvaluator() : base("quote") { }

			public override EvaluationResult Evaluate(object[] parameters, IEnvironment env) {
				if (parameters.Length != 1) {
					throw new SyntaxError("Quote accepts exactly one parameter. Given " + parameters.Length);
				}

				return new EvaluationResult(parameters[0]);
			}
		}
	}
}
